package com.minelx.statementplus.ui.form.dao;

import com.minelx.statementplus.ui.form.vo.ProgressValue;

import java.util.ArrayList;
import java.util.List;

import static java.util.Collections.unmodifiableList;

public class ProgressListModel extends BaseListModel<ProgressValue> {
	private final List<ProgressValue> progressValues;

	public ProgressListModel() {
		progressValues = new ArrayList<>();
	}

	@Override
	public int getSize() {
		return progressValues.size();
	}

	@Override
	public ProgressValue getElementAt(int index) {
		return progressValues.get(index);
	}

	@Override
	protected void append(ProgressValue element) {
		progressValues.add(element);
	}

	@Override
	protected void remove(int index) {
		progressValues.remove(index);
	}

	@Override
	public void removeAll() {
		progressValues.clear();
	}

	@Override
	public List<ProgressValue> toList() {
		return unmodifiableList(progressValues);
	}
}
